﻿/*
 * XCoder v3.4.2011.0316
 * 作者：nnhy/X
 * 时间：2011-04-04 11:42:50
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace NXCMS.Sys
{
	/// <summary>
	/// 分支
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("分支")]
	[BindTable("Branch", Description = "分支", ConnName = "Sys", DbType = DatabaseType.SqlServer)]
	public partial class Branch
	{
		#region 属性
		private Int32 _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "编号", "", "int", 10, 0, false)]
		public Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private String _BranchInnerCode;
		/// <summary>
		/// 分支内部代码
		/// </summary>
		[Description("分支内部代码")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(2, "BranchInnerCode", "分支内部代码", "", "nvarchar(100)", 0, 0, true)]
		public String BranchInnerCode
		{
			get { return _BranchInnerCode; }
			set { if (OnPropertyChange("BranchInnerCode", value)) _BranchInnerCode = value; }
		}

		private String _BranchCode;
		/// <summary>
		/// 分支代码
		/// </summary>
		[Description("分支代码")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(3, "BranchCode", "分支代码", "", "nvarchar(100)", 0, 0, true)]
		public String BranchCode
		{
			get { return _BranchCode; }
			set { if (OnPropertyChange("BranchCode", value)) _BranchCode = value; }
		}

		private String _ParentInnerCode;
		/// <summary>
		/// 父内部代码
		/// </summary>
		[Description("父内部代码")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(4, "ParentInnerCode", "父内部代码", "", "nvarchar(100)", 0, 0, true)]
		public String ParentInnerCode
		{
			get { return _ParentInnerCode; }
			set { if (OnPropertyChange("ParentInnerCode", value)) _ParentInnerCode = value; }
		}

		private String _Type;
		/// <summary>
		/// 类型
		/// </summary>
		[Description("类型")]
		[DataObjectField(false, false, false, 1)]
		[BindColumn(5, "Type", "类型", "", "nvarchar(1)", 0, 0, true)]
		public String Type
		{
			get { return _Type; }
			set { if (OnPropertyChange("Type", value)) _Type = value; }
		}

		private Int32 _OrderFlag;
		/// <summary>
		/// 订单标记
		/// </summary>
		[Description("订单标记")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(6, "OrderFlag", "订单标记", "", "int", 10, 0, false)]
		public Int32 OrderFlag
		{
			get { return _OrderFlag; }
			set { if (OnPropertyChange("OrderFlag", value)) _OrderFlag = value; }
		}

		private String _Name;
		/// <summary>
		/// 名称
		/// </summary>
		[Description("名称")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(7, "Name", "名称", "", "nvarchar(100)", 0, 0, true)]
		public String Name
		{
			get { return _Name; }
			set { if (OnPropertyChange("Name", value)) _Name = value; }
		}

		private Int32 _TreeLevel;
		/// <summary>
		/// 免费等级
		/// </summary>
		[Description("免费等级")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(8, "TreeLevel", "免费等级", "", "int", 10, 0, false)]
		public Int32 TreeLevel
		{
			get { return _TreeLevel; }
			set { if (OnPropertyChange("TreeLevel", value)) _TreeLevel = value; }
		}

		private Boolean _IsLeaf;
		/// <summary>
		/// 是否
		/// </summary>
		[Description("是否")]
		[DataObjectField(false, false, true, 1)]
		[BindColumn(9, "IsLeaf", "是否", "", "bit", 0, 0, false)]
		public Boolean IsLeaf
		{
			get { return _IsLeaf; }
			set { if (OnPropertyChange("IsLeaf", value)) _IsLeaf = value; }
		}

		private String _Phone;
		/// <summary>
		/// 电话
		/// </summary>
		[Description("电话")]
		[DataObjectField(false, false, true, 20)]
		[BindColumn(10, "Phone", "电话", "", "nvarchar(20)", 0, 0, true)]
		public String Phone
		{
			get { return _Phone; }
			set { if (OnPropertyChange("Phone", value)) _Phone = value; }
		}

		private String _Fax;
		/// <summary>
		/// 传真
		/// </summary>
		[Description("传真")]
		[DataObjectField(false, false, true, 20)]
		[BindColumn(11, "Fax", "传真", "", "nvarchar(20)", 0, 0, true)]
		public String Fax
		{
			get { return _Fax; }
			set { if (OnPropertyChange("Fax", value)) _Fax = value; }
		}

		private String _Manager;
		/// <summary>
		/// 管理者
		/// </summary>
		[Description("管理者")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(12, "Manager", "管理者", "", "nvarchar(100)", 0, 0, true)]
		public String Manager
		{
			get { return _Manager; }
			set { if (OnPropertyChange("Manager", value)) _Manager = value; }
		}

		private String _Leader1;
		/// <summary>
		/// 
		/// </summary>
		[Description("")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(13, "Leader1", "", "", "nvarchar(100)", 0, 0, true)]
		public String Leader1
		{
			get { return _Leader1; }
			set { if (OnPropertyChange("Leader1", value)) _Leader1 = value; }
		}

		private String _Leader2;
		/// <summary>
		/// 
		/// </summary>
		[Description("")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(14, "Leader2", "", "", "nvarchar(100)", 0, 0, true)]
		public String Leader2
		{
			get { return _Leader2; }
			set { if (OnPropertyChange("Leader2", value)) _Leader2 = value; }
		}

		private String _Prop1;
		/// <summary>
		/// 属性1
		/// </summary>
		[Description("属性1")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(15, "Prop1", "属性1", "", "nvarchar(50)", 0, 0, true)]
		public String Prop1
		{
			get { return _Prop1; }
			set { if (OnPropertyChange("Prop1", value)) _Prop1 = value; }
		}

		private String _Prop2;
		/// <summary>
		/// 属性2
		/// </summary>
		[Description("属性2")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(16, "Prop2", "属性2", "", "nvarchar(50)", 0, 0, true)]
		public String Prop2
		{
			get { return _Prop2; }
			set { if (OnPropertyChange("Prop2", value)) _Prop2 = value; }
		}

		private String _Prop3;
		/// <summary>
		/// 属性3
		/// </summary>
		[Description("属性3")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(17, "Prop3", "属性3", "", "nvarchar(50)", 0, 0, true)]
		public String Prop3
		{
			get { return _Prop3; }
			set { if (OnPropertyChange("Prop3", value)) _Prop3 = value; }
		}

		private String _Prop4;
		/// <summary>
		/// 属性4
		/// </summary>
		[Description("属性4")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(18, "Prop4", "属性4", "", "nvarchar(50)", 0, 0, true)]
		public String Prop4
		{
			get { return _Prop4; }
			set { if (OnPropertyChange("Prop4", value)) _Prop4 = value; }
		}

		private String _Memo;
		/// <summary>
		/// 注释
		/// </summary>
		[Description("注释")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(19, "Memo", "注释", "", "nvarchar(100)", 0, 0, true)]
		public String Memo
		{
			get { return _Memo; }
			set { if (OnPropertyChange("Memo", value)) _Memo = value; }
		}

		private DateTime _AddTime;
		/// <summary>
		/// 添加时间
		/// </summary>
		[Description("添加时间")]
		[DataObjectField(false, false, false, 7)]
		[BindColumn(20, "AddTime", "添加时间", "", "datetime2", 7, 0, false)]
		public DateTime AddTime
		{
			get { return _AddTime; }
			set { if (OnPropertyChange("AddTime", value)) _AddTime = value; }
		}

		private String _AddUser;
		/// <summary>
		/// 添加用户
		/// </summary>
		[Description("添加用户")]
		[DataObjectField(false, false, false, 200)]
		[BindColumn(21, "AddUser", "添加用户", "", "nvarchar(200)", 0, 0, true)]
		public String AddUser
		{
			get { return _AddUser; }
			set { if (OnPropertyChange("AddUser", value)) _AddUser = value; }
		}

		private DateTime _ModifyTime;
		/// <summary>
		/// 修改时间
		/// </summary>
		[Description("修改时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(22, "ModifyTime", "修改时间", "", "datetime2", 7, 0, false)]
		public DateTime ModifyTime
		{
			get { return _ModifyTime; }
			set { if (OnPropertyChange("ModifyTime", value)) _ModifyTime = value; }
		}

		private String _ModifyUser;
		/// <summary>
		/// 修改用户
		/// </summary>
		[Description("修改用户")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(23, "ModifyUser", "修改用户", "", "nvarchar(200)", 0, 0, true)]
		public String ModifyUser
		{
			get { return _ModifyUser; }
			set { if (OnPropertyChange("ModifyUser", value)) _ModifyUser = value; }
		}

		private String _BackupNo;
		/// <summary>
		/// 备份编号
		/// </summary>
		[Description("备份编号")]
		[DataObjectField(false, false, true, 15)]
		[BindColumn(24, "BackupNo", "备份编号", "", "nvarchar(15)", 0, 0, true)]
		public String BackupNo
		{
			get { return _BackupNo; }
			set { if (OnPropertyChange("BackupNo", value)) _BackupNo = value; }
		}

		private String _BackupOperator;
		/// <summary>
		/// 备份操作者
		/// </summary>
		[Description("备份操作者")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(25, "BackupOperator", "备份操作者", "", "nvarchar(200)", 0, 0, true)]
		public String BackupOperator
		{
			get { return _BackupOperator; }
			set { if (OnPropertyChange("BackupOperator", value)) _BackupOperator = value; }
		}

		private DateTime _BackupTime;
		/// <summary>
		/// 备份时间
		/// </summary>
		[Description("备份时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(26, "BackupTime", "备份时间", "", "datetime2", 7, 0, false)]
		public DateTime BackupTime
		{
			get { return _BackupTime; }
			set { if (OnPropertyChange("BackupTime", value)) _BackupTime = value; }
		}

		private String _BackupMemo;
		/// <summary>
		/// 备份注释
		/// </summary>
		[Description("备份注释")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(27, "BackupMemo", "备份注释", "", "nvarchar(50)", 0, 0, true)]
		public String BackupMemo
		{
			get { return _BackupMemo; }
			set { if (OnPropertyChange("BackupMemo", value)) _BackupMemo = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ID" : return _ID;
					case "BranchInnerCode" : return _BranchInnerCode;
					case "BranchCode" : return _BranchCode;
					case "ParentInnerCode" : return _ParentInnerCode;
					case "Type" : return _Type;
					case "OrderFlag" : return _OrderFlag;
					case "Name" : return _Name;
					case "TreeLevel" : return _TreeLevel;
					case "IsLeaf" : return _IsLeaf;
					case "Phone" : return _Phone;
					case "Fax" : return _Fax;
					case "Manager" : return _Manager;
					case "Leader1" : return _Leader1;
					case "Leader2" : return _Leader2;
					case "Prop1" : return _Prop1;
					case "Prop2" : return _Prop2;
					case "Prop3" : return _Prop3;
					case "Prop4" : return _Prop4;
					case "Memo" : return _Memo;
					case "AddTime" : return _AddTime;
					case "AddUser" : return _AddUser;
					case "ModifyTime" : return _ModifyTime;
					case "ModifyUser" : return _ModifyUser;
					case "BackupNo" : return _BackupNo;
					case "BackupOperator" : return _BackupOperator;
					case "BackupTime" : return _BackupTime;
					case "BackupMemo" : return _BackupMemo;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ID" : _ID = Convert.ToInt32(value); break;
					case "BranchInnerCode" : _BranchInnerCode = Convert.ToString(value); break;
					case "BranchCode" : _BranchCode = Convert.ToString(value); break;
					case "ParentInnerCode" : _ParentInnerCode = Convert.ToString(value); break;
					case "Type" : _Type = Convert.ToString(value); break;
					case "OrderFlag" : _OrderFlag = Convert.ToInt32(value); break;
					case "Name" : _Name = Convert.ToString(value); break;
					case "TreeLevel" : _TreeLevel = Convert.ToInt32(value); break;
					case "IsLeaf" : _IsLeaf = Convert.ToBoolean(value); break;
					case "Phone" : _Phone = Convert.ToString(value); break;
					case "Fax" : _Fax = Convert.ToString(value); break;
					case "Manager" : _Manager = Convert.ToString(value); break;
					case "Leader1" : _Leader1 = Convert.ToString(value); break;
					case "Leader2" : _Leader2 = Convert.ToString(value); break;
					case "Prop1" : _Prop1 = Convert.ToString(value); break;
					case "Prop2" : _Prop2 = Convert.ToString(value); break;
					case "Prop3" : _Prop3 = Convert.ToString(value); break;
					case "Prop4" : _Prop4 = Convert.ToString(value); break;
					case "Memo" : _Memo = Convert.ToString(value); break;
					case "AddTime" : _AddTime = Convert.ToDateTime(value); break;
					case "AddUser" : _AddUser = Convert.ToString(value); break;
					case "ModifyTime" : _ModifyTime = Convert.ToDateTime(value); break;
					case "ModifyUser" : _ModifyUser = Convert.ToString(value); break;
					case "BackupNo" : _BackupNo = Convert.ToString(value); break;
					case "BackupOperator" : _BackupOperator = Convert.ToString(value); break;
					case "BackupTime" : _BackupTime = Convert.ToDateTime(value); break;
					case "BackupMemo" : _BackupMemo = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得分支字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 分支内部代码
			///</summary>
			public const String BranchInnerCode = "BranchInnerCode";

			///<summary>
			/// 分支代码
			///</summary>
			public const String BranchCode = "BranchCode";

			///<summary>
			/// 父内部代码
			///</summary>
			public const String ParentInnerCode = "ParentInnerCode";

			///<summary>
			/// 类型
			///</summary>
			public const String Type = "Type";

			///<summary>
			/// 订单标记
			///</summary>
			public const String OrderFlag = "OrderFlag";

			///<summary>
			/// 名称
			///</summary>
			public const String Name = "Name";

			///<summary>
			/// 免费等级
			///</summary>
			public const String TreeLevel = "TreeLevel";

			///<summary>
			/// 是否
			///</summary>
			public const String IsLeaf = "IsLeaf";

			///<summary>
			/// 电话
			///</summary>
			public const String Phone = "Phone";

			///<summary>
			/// 传真
			///</summary>
			public const String Fax = "Fax";

			///<summary>
			/// 管理者
			///</summary>
			public const String Manager = "Manager";

			///<summary>
			/// 
			///</summary>
			public const String Leader1 = "Leader1";

			///<summary>
			/// 
			///</summary>
			public const String Leader2 = "Leader2";

			///<summary>
			/// 属性1
			///</summary>
			public const String Prop1 = "Prop1";

			///<summary>
			/// 属性2
			///</summary>
			public const String Prop2 = "Prop2";

			///<summary>
			/// 属性3
			///</summary>
			public const String Prop3 = "Prop3";

			///<summary>
			/// 属性4
			///</summary>
			public const String Prop4 = "Prop4";

			///<summary>
			/// 注释
			///</summary>
			public const String Memo = "Memo";

			///<summary>
			/// 添加时间
			///</summary>
			public const String AddTime = "AddTime";

			///<summary>
			/// 添加用户
			///</summary>
			public const String AddUser = "AddUser";

			///<summary>
			/// 修改时间
			///</summary>
			public const String ModifyTime = "ModifyTime";

			///<summary>
			/// 修改用户
			///</summary>
			public const String ModifyUser = "ModifyUser";

			///<summary>
			/// 备份编号
			///</summary>
			public const String BackupNo = "BackupNo";

			///<summary>
			/// 备份操作者
			///</summary>
			public const String BackupOperator = "BackupOperator";

			///<summary>
			/// 备份时间
			///</summary>
			public const String BackupTime = "BackupTime";

			///<summary>
			/// 备份注释
			///</summary>
			public const String BackupMemo = "BackupMemo";
		}
		#endregion
	}
}